import { forwardRef, Module } from '@nestjs/common';
import { AdminUserService } from './admin-user.service';
import { AdminUserController } from './admin-user.controller';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AdminUser } from './entities/admin-user.entity';
import { JwtModule } from '@nestjs/jwt';
import { jwtConstants, signOptions } from 'src/common/auth/constants';
import { PassportModule } from '@nestjs/passport';
import { RoleModule } from '../role/role.module';
import { OperationRecordModule } from '../operation-record/operation-record.module';

@Module({
  imports: [
    TypeOrmModule.forFeature([AdminUser]),
    PassportModule,
    JwtModule.register({
      secret: jwtConstants.secret,
      signOptions,
    }),
    forwardRef(() => RoleModule),
    forwardRef(() => OperationRecordModule),
  ],
  controllers: [AdminUserController],
  providers: [AdminUserService],
  exports: [AdminUserService],
})
export class AdminUserModule { }
